var isAndorid, PushManager, context, Instance, GeTuiSdk;

if (plus.os.name == 'Android') {
	isAndorid = true;
} else {
	isAndorid = false;
}

if (isAndorid) {
	PushManager = plus.android.importClass("com.igexin.sdk.PushManager");
	context = plus.android.runtimeMainActivity().getContext();
	Instance = PushManager.getInstance();
} else {
	GeTuiSdk = plus.ios.importClass("GeTuiSdk");
}

const tool = {
	//开启推送
	turnOnPush: function() {
		if (isAndorid) {
			Instance.turnOnPush(context);
		} else {
			GeTuiSdk.setPushModeForOff(false);
		}
	},
	//关闭推送
	turnOffPush: function() {
		if (isAndorid) {
			Instance.turnOffPush(context);
		} else {
			GeTuiSdk.setPushModeForOff(true);
		}
	}
}
export default tool